<?php

// child theme functions...

add_action( 'init', 'mm_activate_post_types' );


function mm_activate_post_types()
	{ 
                mm_create_post_type('product','Product','Products','product');
                mm_create_post_type_slide('slide', 'Slide', 'Slides', 'slide');
	}



       /* 
        
        register_post_type( 'slide', array(
	
	'show_in_menu' => 'themes.php',
	'show_in_nav_menus' => false,
	'supports' => array( 'thumbnail' )
) );
        */
        
        // I can get rid of this and only use my cpt plugin? 
        
	function mm_create_post_type_slide($pt_name,$single_name,$plural_name,$slug) 
	{
		register_post_type( $pt_name,
		array(
			//'menu_position' => 4,
                        'show_in_menu' => 'themes.php',
                        'show_in_nav_menus' => false,
			'exclude_from_search' => false,
			'labels' => array(
				'name' => __( "$plural_name" ),
				'singular_name' => __( "$single_name" ),
				'add_new' => _x('Add New', "$single_name"),
				'add_new_item' => __("Add New $single_name"),
				'edit_item' => __("Edit $single_name"),
				'new_item' => __("New $single_name"),
				'all_items' => __("$plural_name"),
				'view_item' => __("View $single_name"),
				'search_items' => __("Search $plural_name"),
				'not_found' =>  __("No $single_name found"),
				'not_found_in_trash' => __("No $single_name found in Trash"), 
				'parent_item_colon' => '',
				'menu_name' => "$plural_name"	
			),
		'public' => true,
		'_builtin' => false,
		'rewrite' => array("slug"=>"$slug"),
		'has_archive' => true,
		'supports' => array('thumbnail'),
		'taxonomies' => array('post_tag','category')
			)
		);
	}







// this is the custom code from HHS slide to make the slide cpt display a certain way...

add_action( 'add_meta_boxes_slide',  'hhs_slide_add_meta_boxes' );
add_filter( 'admin_post_thumbnail_html', 'hhs_slide_post_thumbnail_html' );

function hhs_slide_add_meta_boxes() {
	remove_meta_box( 'postimagediv', 'slide', 'side' );

	add_meta_box( 'postimagediv', 'Slide Image', 'post_thumbnail_meta_box', 'slide', 'normal', 'high' );
}

function hhs_slide_post_thumbnail_html( $output ) {
	global $post_type;

	// beware of translated admin
	if ( ! empty ( $post_type ) && 'slide' == $post_type ) {
		$output = str_replace( 'Set featured image', 'Select / Upload a slide image', $output );
		$output = str_replace( 'Remove featured image', 'Remove slide image', $output );
	}

	return $output;
}



  $labels = array(
    'name' => _x( 'Jewelry Type', 'taxonomy general name' ),
    'singular_name' => _x( 'Jewelry Type', 'taxonomy singular name' ),
    'search_items' =>  __( 'Search Jewelry Type' ),
    'all_items' => __( 'All Jewelry Type' ),
    'parent_item' => __( 'Parent Jewelry Type' ),
    'parent_item_colon' => __( 'Parent Jewelry Type:' ),
    'edit_item' => __( 'Edit Jewelry Type' ), 
    'update_item' => __( 'Update Jewelry Type' ),
    'add_new_item' => __( 'Add New Jewelry Type' ),
    'new_item_name' => __( 'New Jewelry Type Name' ),
    'menu_name' => __( 'Jewelry Type' ),
  ); 	

  register_taxonomy('jewelry_type',array('product'), array(
    'hierarchical' => true,
    'labels' => $labels,
    'show_ui' => true,
    'query_var' => true,
    'rewrite' => array( 'slug' => 'jewelrytype' ),
  ));





     
?>